<?php

DEFINE ('DB_USER', 'root');
DEFINE ('DB_PASSWORD', 'root');
DEFINE ('DB_HOST', 'localhost');
DEFINE ('DB_NAME', 'irrealworld');
error_reporting(E_ALL);
ini_set('display_errors', '1');



$nick=$_REQUEST['nickname'];
$pw=$_REQUEST['pw'];
$gender=$_REQUEST['gender'];
$orden=$_REQUEST['orden'];
$pw = md5($pw);
$captcha = $_REQUEST['captcha'];
if($captcha==8){
$dbc = @mysqli_connect (DB_HOST, DB_USER, DB_PASSWORD, DB_NAME) OR die
('Could not connect to MySQL: '.mysqli_connect_error() );


$q = "INSERT INTO register_t (login,
password, gender, orden) VALUES ('$nick', '$pw', '$gender', '$orden')";

$r = @mysqli_query ($dbc, $q); // Run the query.

if ($r) { // If it ran OK.

	// Print a message:
	echo '<h1>Thank you!</h1>
<p>You are now registered. In Chapter
you will actually be able to log
in!</p><p><br /></p>';

 } else { // If it did not run OK.

 // Public message:
 echo '<h1>System Error</h1>
	<p class="error">You could not be
	registered due to a system error.
	We apologize for any
	inconvenience.</p>';
 }
 
 $q = "INSERT INTO authorization_t (login,
password) VALUES ('$nick', '$pw')";
 
 $r = @mysqli_query ($dbc, $q); // Run the query.
 
 echo "<br>written in auth";
 @mysql_close($dbc);
} else {
	echo "Wrong number!";
}
	?>